<template>
	<view class="page-content">
		<u-parse :content="data"></u-parse>
	</view>
</template>

<script>
	import {
		getAboutUs,
		getService,
		getNotify
	} from '@/config/api.js'
	export default {
		data() {
			return {
				data: "",
				id: ""
			}
		},
		onLoad(op) {
			this.tag = op.tag;
			this.id = op.id
			this.getData();
		},
		methods: {
			getData() {
				if (this.tag == "getAboutUs") {
					uni.setNavigationBarTitle({
						title: '关于我们'
					});
					getAboutUs({
						keys: "AboutUs"
					}).then(res => {
						this.data = res.content;
					});
				}
				if (this.tag == "getService") {
					uni.setNavigationBarTitle({
						title: '客服'
					});
					getAboutUs({
						keys: "CustomerService"
					}).then(res => {
						this.data = res.content;
					});
				}
				if (this.tag == "notify") {
					uni.setNavigationBarTitle({
						title: '通知详情'
					});
					getNotify({
						id: this.id
					}).then(res => {
						var tmp = res.list[0];
						this.data = tmp.content;
					});
				}
			}
		}
	}
</script>

<style>

</style>
